<template>
	<view :style="themeColor">
		<view class="page">
			<view
				class="flex flex-direction flex-wrap align-stretch justify-center benben-position-layout flex feedBack_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-stretch justify-between feedBack_fd0_0'>
					<view class='flex flex-wrap align-center feedBack_fd0_0_c0' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">
						<text class='fu-iconfont2  feedBack_fd0_0_c0_c0'>&#xe794;</text>
					</view>
					<view class='flex flex-wrap align-center'>
						<text class='feedBack_fd0_0_c1_c0'>意见反馈</text>
					</view>
					<view class='flex align-center justify-end feedBack_fd0_0_c2' @tap.stop="handleJumpDiy"
						data-type="navigateTo" :data-url="`/pages/setUp/feedbackRecord/feedbackRecord`"
						v-if="appSystemIdentification!='Wechat'">
						<text class='feedBack_fd0_0_c2_c0'>反馈记录</text>
					</view>
					<view class='flex align-center justify-end feedBack_fd0_0_c2'
						v-if="appSystemIdentification=='Wechat'">
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---意见反馈表单flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout feedBack_flex_1">
				<view class='flex flex-wrap align-center justify-between feedBack_fd1_0'>
					<text class='feedBack_fd1_0_c0'>反馈类型</text>
					<text class='feedBack_fd1_0_c0' @tap.stop="handleJumpDiy" data-type="navigateTo"
						:data-url="`/pages/setUp/feedbackRecord/feedbackRecord`"
						v-if="appSystemIdentification=='Wechat'">反馈记录</text>
				</view>
				<view class='flex flex-direction flex-wrap align-stretch feedBack_fd1_1'>
					<benben-select-diy ref="showSelectPopup1686920939444" class-name='flex flex-wrap align-center flex'
						:items.sync="changeType" v-model="changeId" default-type="aid" default-label="title"
						:allow-cancel='true' type="radio" :disabled='false'>
						<template v-for='(item,key0) in changeType'>
							<view v-if="item.isSelected"
								class='flex align-center justify-center flex feedBack_fd1_1_c0_c0' :key="key0"
								@tap="$refs.showSelectPopup1686920939444.tapHandle(key0)">
								<text class='flex-sub feedBack_fd1_1_c0_c0_c0'>{{item.title}}</text>
							</view>
							<view v-else class='flex align-center justify-center flex feedBack_fd1_1_c0_c1' :key="key0"
								@tap="$refs.showSelectPopup1686920939444.tapHandle(key0)">
								<text class='flex-sub feedBack_fd1_1_c0_c1_c0'>{{item.title}}</text>
							</view>
						</template></benben-select-diy>
				</view>
				<text class='feedBack_fd1_2'>反馈内容</text>
				<view class='flex flex-direction flex-wrap align-stretch feedBack_fd1_3'>
					<view class='flex flex-wrap feedBack_fd1_3_c0'>
						<textarea class='flex feedBack_input_fd1_3_c0' confirm-type="done"
							:placeholder="'问题描述的越详细，有助于我们更快的解决问题'" :maxlength="240"
							placeholder-style="color:rgba(191, 191, 191, 1);font-size:28rpx" v-model="body" />

					</view>
					<view class='flex flex-direction flex-wrap align-stretch'>
						<benben-images-upload ref="benbenImagesUploadfd1_3_c1_c0" :img-list.sync="thumbList"
							:img-ids.sync="thumb" :maxlength="9">
							<template #content="{ num, maxlength, isShow, imgList }">
								<view class="flex flex-wrap align-start flex feedBack_fd1_3_c1_c0">

									<view v-for="(image, index) in imgList" :key="index"
										class='flex position-relative feedBack_fd1_3_c1_c00'>
										<text class='fu-iconfont2 position-absolute feedBack_fd1_3_c1_c000'
											@tap.stop="$refs.benbenImagesUploadfd1_3_c1_c0.delImage(index)">&#xE8E7;</text>
										<image class='feedBack_fd1_3_c1_c001'
											@tap.stop="$refs.benbenImagesUploadfd1_3_c1_c0.previewImage(index)"
											mode="aspectFill" :src='image'></image>
									</view>
									<image class='feedBack_fd1_3_c1_c01'
										@tap.stop="$refs.benbenImagesUploadfd1_3_c1_c0.manyChooseImage()" v-if="isShow"
										mode="aspectFit" :src='STATIC_URL+"51.png"'></image>
								</view>
							</template>
						</benben-images-upload>
					</view>
				</view>
			</view>

			<!---意见反馈表单flex布局结束-->
			<view class="flex flex-wrap align-center justify-center benben-position-layout flex feedBack_flex_2">
				<button class='flex-sub feedBack_fd2_0' @tap.stop="postFeedbackFunc()">提交</button>

			</view>
			<view :style="{height: '88rpx'}"></view>


		</view>
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},


		data() {
			return {
				"changeId": "",
				"changeType": [],
				"body": "",
				"thumbList": [],
				"thumb": ""
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},
			/**
			 * @returns 
			 * Android       安卓
			 * IOS       苹果
			 * Web       H5 或 pc
			 * Wechat       微信小程序
			 * Alipay       支付宝小程序
			 * Baidu       百度小程序
			 * ByteBounce       抖音小程序
			 * 360       360小程序
			 * FastApp       快应用
			 */
			appSystemIdentification() {
				return this.$store.state.appSystemIdentification
			},
		},
		watch: {},
		onLoad(options) {
			this.getFeedbackFunc()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取反馈信息
			async getFeedbackFunc() {
				//请求方法
				//数据验证

				let datachangeType = await this.$api.get(global.apiUrls.post636dbfbfd7b81, {

				});

				if (datachangeType.data.code != 1) {
					this.$message.info(datachangeType.data.msg);
					return
				}
				let infochangeType = datachangeType.data;
				this.changeType = infochangeType.data

				this.changeId = this.changeType[0].aid
			},
			//提交反馈信息
			async postFeedbackFunc() {
				if (!validate(this.changeId, 'require')) {
					this.$message.info('反馈类型不能为空');
					return false;
				}
				if (!validate(this.body, 'require')) {
					this.$message.info('反馈内容不能为空');
					return false;
				}
				if (this.thumbList.length == 0) {
					this.$message.info('请上传图片');
					return false;
				}
				//请求方法
				//数据验证

				let data636dc0bcb5991 = await this.$api.dbPost(global.apiUrls.post636dc0bcb5991, {
					body: this.body,
					thumb: this.thumbList,
					type: this.changeId
				});
				if (!data636dc0bcb5991) return
				if (data636dc0bcb5991.data.code != 1) {
					this.$message.info(data636dc0bcb5991.data.msg);
					return
				}



				this.$message.info('反馈成功');
				setTimeout(() => {
					this.$urouter.navigateBack(1);
				}, 500)
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: rgba(250, 250, 250, 1);
		background-size: 100% auto;
	}

	.feedBack_flex_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.feedBack_fd0_0_c2_c0 {
		font-size: 30rpx;
		font-weight: 500;
		color: #333333;
		line-height: 40rpx;
	}

	.feedBack_fd0_0_c2 {
		padding: 0rpx 0rpx 0rpx 0rpx;
		width: 200rpx;
	}

	.feedBack_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333333;
		line-height: 50rpx;
	}

	.feedBack_fd0_0_c0_c0 {
		font-size: 36rpx;
		font-weight: 400;
		color: #333;
	}

	.feedBack_fd0_0_c0 {
		width: 200rpx;
	}

	.feedBack_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		line-height: 88rpx;
	}

	.feedBack_flex_1 {
		background: #fff;
		background-size: 100% auto !important;
	}

	.feedBack_fd1_3_c1_c01 {
		width: 160rpx;
		height: 160rpx;
		margin: 0rpx 24rpx 24rpx 0rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.feedBack_fd1_3_c1_c001 {
		width: 160rpx;
		height: 160rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.feedBack_fd1_3_c1_c000 {
		top: 0rpx;
		right: 0rpx;
		z-index: 10;
		color: #ff5536;
	}

	.feedBack_fd1_3_c1_c00 {
		margin: 0rpx 24rpx 24rpx 0rpx;
	}

	.feedBack_fd1_3_c1_c0 {
		padding: 24rpx 0rpx 0rpx 32rpx;
	}

	.feedBack_input_fd1_3_c0 {
		width: 100%;
		height: 300rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #333;
	}

	.feedBack_fd1_3_c0 {
		width: 686rpx;
		border-radius: 10rpx 10rpx 10rpx 10rpx;
		margin: 0rpx 0rpx 0rpx 32rpx;
		padding: 0rpx 0rpx 24rpx 0rpx;
	}

	.feedBack_fd1_3 {
		margin: 0rpx 0rpx 32rpx 0rpx;
	}

	.feedBack_fd1_2 {
		font-size: 32rpx;
		font-weight: 500;
		color: #1A1A1A;
		line-height: 109rpx;
		margin: 0rpx 32rpx 0rpx 32rpx;
	}

	.feedBack_fd1_1_c0_c1_c0 {
		font-size: 26rpx;
		font-weight: 400;
		color: rgba(51, 51, 51, 1);
		line-height: 60rpx;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		text-align: center;
	}

	.feedBack_fd1_1_c0_c1 {
		background: rgba(246, 247, 249, 1);
		margin: 16rpx 8rpx 16rpx 8rpx;
		height: 64rpx;
		border-radius: 32rpx 32rpx 32rpx 32rpx;
		width: 218rpx;
	}

	.feedBack_fd1_1_c0_c0_c0 {
		font-size: 26rpx;
		font-weight: 400;
		color: #fff;
		line-height: 60rpx;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		text-align: center;
	}

	.feedBack_fd1_1_c0_c0 {
		background: rgba(48, 144, 255, 1);
		margin: 16rpx 8rpx 16rpx 8rpx;
		height: 64rpx;
		border-radius: 32rpx 32rpx 32rpx 32rpx;
		width: 218rpx;
	}

	.feedBack_fd1_1 {
		border-bottom: 10px solid rgba(246, 247, 248, 1);
		padding: 0rpx 24rpx 16rpx 24rpx;
	}

	.feedBack_fd1_0_c0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #1A1A1A;
	}

	.feedBack_fd1_0 {
		padding: 32rpx 32rpx 32rpx 32rpx;
	}

	.feedBack_flex_2 {
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		bottom: calc(48rpx + var(--window-bottom));
	}

	.feedBack_fd2_0 {
		background: rgba(48, 144, 255, 1);
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		font-size: 32rpx;
		color: #fff;
		margin: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
		line-height: 88rpx;
		width: 638rpx;
	}
</style>